﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Fruit.BLL;

namespace Fruit.UI
{
    public partial class Fruit_UserInfo : Form
    {
        public Fruit_UserInfo()
        {
            InitializeComponent();

            SexManager manager = new SexManager();
            AuthorityManager authorityManager = new AuthorityManager();
            // 绑定性别
            cmbSex.DataSource = manager.GetAllSex();
            // 实际值，显示值
            cmbSex.DisplayMember = "Name";
            cmbSex.ValueMember = "Id";

            // 绑定用户权限
            cmbUserType.DataSource = authorityManager.GetAllAuthority();
            cmbUserType.DisplayMember = "Name";
            cmbUserType.ValueMember = "Id";
        }

        /// <summary>
        /// 新增或者修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAffirm_Click(object sender, EventArgs e)
        {

        }

        private void Fruit_UserInfo_Load(object sender, EventArgs e)
        {
            //SexManager manager = new SexManager();
            //AuthorityManager authorityManager = new AuthorityManager();
            //// 绑定性别
            //cmbSex.DataSource = manager.GetAllSex();
            //// 实际值，显示值
            //cmbSex.DisplayMember = "Name";
            //cmbSex.ValueMember = "Id";

            //// 绑定用户权限
            //cmbUserType.DataSource = authorityManager.GetAllAuthority();
            //cmbUserType.DisplayMember = "Name";
            //cmbUserType.ValueMember = "Id";
        }
    }
}
